<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>
        // 1. 获取当前日期对象
        const date = new Date()
        console.log(date)

        console.log(date.toDateString()) // Tue Dec 10 2024
        console.log(date.toTimeString()) // 13:10:13 GMT+0800 (中国标准时间)
        console.log(date.toLocaleDateString()) // 2024/12/10
        console.log(date.toLocaleTimeString()) // 13:09:57
        

    </script>
    
</body>
</html>